use axum::{
    routing::{get, post},
    Router,
};
use dotenv::dotenv;

mod tasks;

#[tokio::main]
async fn main() {
    dotenv().ok();
    let app = Router::new()
        .route("/api/create_task", post(tasks::create_task))
        .route("/api/task/:task_id", get(tasks::task));
    let listener = tokio::net::TcpListener::bind("0.0.0.0:3000").await.unwrap();
    axum::serve(listener, app).await.unwrap();
}
